﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Entity;
using HP.Cachalote.DataModels;
using HP.Cachalote.Repositories.EntityFramework.Mappings;

namespace HP.Cachalote.Repositories.EntityFramework
{
    public class CachaloteContext : DbContext
    {
        static CachaloteContext()
        {
            Database.SetInitializer<CachaloteContext>(null);
        }

        public CachaloteContext()
            : base("Name=Todo")
        {
        }

        public DbSet<TodoLabel> TodoLabels { get; set; }
        public DbSet<TodoItem> TodoItems { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Configurations.Add(new TodoLabelMap());
            modelBuilder.Configurations.Add(new TodoItemMap());
        }
    }
}
